package com.leyou.search.entity;

import com.leyou.item.dto.SkuDTO;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author 虎哥
 */
@Data
public class Sku {
    private Long id;
    private String title;
    private String image;
    private Long price;

    public Sku(SkuDTO skuDTO) {
        this.id = skuDTO.getId();
        this.title = skuDTO.getTitle();
        this.image = StringUtils.substringBefore(skuDTO.getImages(), ",");
        this.price = skuDTO.getPrice();
    }
}
